package org.sample.springbootrabbitmq.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MessageReceiver {

	private static final Logger LOGGER = LoggerFactory.getLogger(MessageReceiver.class);

	@RabbitListener(queues = "textQueue")
	public void receiveText(String message) {
		LOGGER.info("Received text: {}", message);
	}

	@RabbitListener(queues = "userEventQueue")
	public void receiveUserEvent(String message) {
		LOGGER.info("Received user event: {}", message);
	}

	@RabbitListener(queues = "itemEventQueue")
	public void receiveItemEvent(String message) {
		LOGGER.info("Received item event: {}", message);
	}

}
